<!-----------------------------------------------------------------------
//
//	Copyright 2002 e Professional Corporation.  All Rights Reserved.
//
//	File:	errorPage.jsp
//
//	Author:	Manz
//
//	Date:	14/05/2002
//
//-------------------------------------------------------------------- -->
<%@ page isErrorPage="true" import="com.epro.standard.frontend.util.*" contentType="text/html; charset=windows-874"%>
<%
	String context = request.getContextPath();
%>
<HTML>
<HEAD>
<TITLE>errorPage</TITLE>
<LINK href="<%=context%>/theme/defaultTheme.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!--
function gotoLoginPage() {
	var loginPageUrl = "<%=context%>/CFRLWEBLN00.jsp?logout="; // Login URL
  //var loginPageUrl = "<%=context%>/RTAPPSPLN00.jsp"; // Login URL
	var loginFrame = "mainIFrame"; // Main frame name
	var checkObj = eval("top."+loginFrame); // Frame object for check this frame is main frame
	var windowArray = new Array(); // Array for keep each window that opened
	var index = 0; // Index for windowArray
	var initStr = ""; // Initial string of windows

// Check frame object is main frame and keep each window that opened to array
	while (checkObj == undefined) {
		if (eval(initStr+"top.opener") != undefined) {
			initStr += "top.opener.";
			windowArray[index] = "top.opener";
		} else if (eval(initStr+"top.dialogArguments") != undefined) {
			initStr += "top.dialogArguments.";
			windowArray[index] = "top.dialogArguments";
		}
		checkObj = eval(initStr+"top."+loginFrame);
		index++;
// For stop program that not open from standard page
		if (index == 10) {
			break;
		}
	}

if (index < 10) {
// Show login page at main frame
	checkObj.top.location.href = loginPageUrl;

// Close all window that opened except main window;
	initStr = "";
	if (windowArray.length > 0) {
		top.close();
		for (var i=0; i<windowArray.length-1; i++) {
			initStr += windowArray[i];
			eval(initStr+".top").close();
		}
	}
} else {
	alert("Why you not login ?");
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<TABLE border="0" height="300">
	<TBODY>
		<TR height="20"><TD>Please Login Again</TD></TR>
		<TR height="20"><TD><INPUT TYPE="button" class="btn" value="Go to Login page" onclick="gotoLoginPage()"></TD></TR>
		<TR><TD>&nbsp;</TD></TR>
	</TBODY>
</TABLE>
<TABLE border="0">
	<TBODY>
		<TR><TD>Found Error Exception</TD></TR>
		<TR><TD><%= exception.toString()%></TD></TR>
		<TR><TD>&nbsp;<%//=exception.printStackTrace()%></TD></TR>
<%
//exception.printStackTrace();
/*
	java.lang.StackTraceElement[] ste = exception.getStackTrace();
	for (int i=0; i<ste.length; i++) {
%>
		<TR><TD><%= //ste[i].toString()%></TD></TR> 
<%
	}
*/
%>
	</TBODY>
</TABLE>
</BODY>
</HTML>